<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>Jin Tian</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
  
  <meta name="description" content="Just My Blog">
<meta property="og:type" content="website">
<meta property="og:title" content="Jin Tian">
<meta property="og:url" content="http://yoursite.com/page/6/index.html">
<meta property="og:site_name" content="Jin Tian">
<meta property="og:description" content="Just My Blog">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Jin Tian">
<meta name="twitter:description" content="Just My Blog">
  
    <link rel="alternate" href="/atom.xml" title="Jin Tian" type="application/atom+xml">
  

  

  <link rel="icon" href="/css/images/mylogo.jpg">
  <link rel="apple-touch-icon" href="/css/images/mylogo.jpg">
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link href="https://fonts.googleapis.com/css?family=Open+Sans|Montserrat:700" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic" rel="stylesheet" type="text/css">
  <link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
  <style type="text/css">
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/9749f0/00000000000000000001008f/27/l?subset_id=2&fvd=n5) format("woff2");font-weight:500;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/90cf9f/000000000000000000010091/27/l?subset_id=2&fvd=n7) format("woff2");font-weight:500;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/8a5494/000000000000000000013365/27/l?subset_id=2&fvd=n4) format("woff2");font-weight:lighter;font-style:normal;}
    @font-face{font-family:futura-pt;src:url(https://use.typekit.net/af/d337d8/000000000000000000010095/27/l?subset_id=2&fvd=i4) format("woff2");font-weight:400;font-style:italic;}</style>
  <link rel="stylesheet" href="/css/style.css">

  <script src="/js/jquery-3.1.1.min.js"></script>
  <script src="/js/bootstrap.js"></script>

  <!-- Bootstrap core CSS -->
  <link rel="stylesheet" href="/css/bootstrap.css" >

  
    <link rel="stylesheet" href="/css/home.css" >
  

  

  

  
  
  
    <link rel="stylesheet" href="/css/vdonate.css" >
  

</head>



  <body>


  
    <header id="header">

	<!-- 背景图模式 -->
	

    
      <div id="intrologo" class="intro-logo">
    
 


    <canvas width="100%" height="100%"></canvas>
    <script>
      var c = document.getElementsByTagName('canvas')[0],
          x = c.getContext('2d'),
          w = window.innerWidth,
          h = window.innerHeight,
          pr = window.devicePixelRatio || 1,
          f = 90,
          q,
          m = Math,
          r = 0,
          u = m.PI*2,
          v = m.cos,
          z = m.random
      c.width = w*pr
      c.height = h*pr
      x.scale(pr, pr)
      x.globalAlpha = 0.6

      <!-- 折线Polyline背景 -->
      
        function i(){
            x.clearRect(0,0,w,h)
            q=[{x:0,y:h*.7+f},{x:0,y:h*.7-f}]
            while(q[1].x<w+f) d(q[0], q[1])
        }
        function d(i,j){   
            x.beginPath()
            x.moveTo(i.x, i.y)
            x.lineTo(j.x, j.y)
            var k = j.x + (z()*2-0.25)*f,
                n = y(j.y)
            x.lineTo(k, n)
            x.closePath()
            r-=u/-50
            x.fillStyle = '#'+(v(r)*127+128<<16 | v(r+u/3)*127+128<<8 | v(r+u/3*2)*127+128).toString(16)
            x.fill()
            q[0] = q[1]
            q[1] = {x:k,y:n}
        }
        function y(p){
            var t = p + (z()*2-1.1)*f
            return (t>h||t<0) ? y(p) : t
        }
        document.getElementById("intrologo").onclick = i
        document.getElementById("intrologo").ontouchstart = i
        i()

      <!-- 多边形trianglify背景 -->
      
    </script>
    

    
      <div id="homelogo" class="homelogo"> 
    

        
          <div class="homelogoback" >
            <h1><a href="#content" id="logo">Jin Tian</a></h1>
            <h3>Just My Blog</h3>
            <h5>Jintian</h5>
            <!-- <p><a href="https://github.com/iTimeTraveler" target="_blank">Github</a></p> -->
          </div>
        
    
    </div>
  </div>

  <!-- 自适应主页背景大图 -->
  

 <!-- home_logo_image居中 -->
 
    <script>
        var homelogodiv = document.getElementById("homelogo");
        if (document.all.homelogo.offsetWidth > document.body.clientWidth) {
          homelogodiv.style.width = document.body.clientWidth + "px";
          homelogodiv.style.marginLeft = document.body.clientWidth * -0.5 + "px";
        } else {
          homelogodiv.style.width = homelogodiv.clientWidth  + "px";
          homelogodiv.style.marginLeft = (homelogodiv.clientWidth)  * -0.5 + "px";
        }
    </script>
  

  <div class="intro-navigate">
      <p class="navigater-list">
        
          <a id="beautifont" class="main-nav-link" href="/">首页</a>
        
          <a id="beautifont" class="main-nav-link" href="/archives">归档</a>
        
          <a id="beautifont" class="main-nav-link" href="/categories">分类</a>
        
          <a id="beautifont" class="main-nav-link" href="/tags">标签</a>
        
          <a id="beautifont" class="main-nav-link" href="/about">关于</a>
        
          <a id="beautifont" class="main-nav-link" href="http://luoli-luoli.com/chat">chat</a>
        
      </p>
  </div>

</header>
  
  <div id="container">
    <div id="wrap">
      
            
      <div id="content" class="outer">
        
          <section id="main" style="float:none;">
  
    <article id="post-2017-1-6-OpenCV-Clion-C++-开发环境搭建教程"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/02/01/2017-1-6-OpenCV-Clion-C++-开发环境搭建教程/">Ubuntu下用Clion和C++开发OpenCV程序教程</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/02/01/2017-1-6-OpenCV-Clion-C++-开发环境搭建教程/" class="article-date">
	  <time datetime="2017-02-01T02:31:45.000Z" itemprop="datePublished">2017-02-01</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="Ubuntu下用Clion和C-开发OpenCV程序教程"><a href="#Ubuntu下用Clion和C-开发OpenCV程序教程" class="headerlink" title="Ubuntu下用Clion和C++开发OpenCV程序教程"></a>Ubuntu下用Clion和C++开发OpenCV程序教程</h2><blockquote>
<p>本教程作者是在读硕士金天童鞋，在当地较为英俊的男子，大家对教程有任何疑问欢迎联系我：WeChat<br><code>jintianiloveu</code>，同时也欢迎大家转载评论，不过请保留这段版权信息，桑口～</p>
</blockquote>
<h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>在开车之前必须要扯几句，好多天没有更新博客，你在我的官网，或者简书上都看不到我最近的活动，最近在忙着搞无人驾驶，虽然官方博客没有更新但是在github上却有很多小项目，首先放出我的github地址，<a href="http://github/com/jinfagang" target="_blank" rel="noopener">这里</a>，这几天写了一个爬虫爬取12306网站的脚本，直接在terminal显示余票信息，并可以智能提醒你余票，过年了，有想玩的同学们可以star一下我的这个项目<a href="http://github.com/jinfagang/Spider12306.git" target="_blank" rel="noopener">12306爬虫</a>欢迎大家star，多多益善啊我的星星实在是太少了。好了不扯淡了，蛋也快碎了。让我们直接开车吧。</p>
<h3 id="OpenCV在Ubuntu下安装"><a href="#OpenCV在Ubuntu下安装" class="headerlink" title="OpenCV在Ubuntu下安装"></a>OpenCV在Ubuntu下安装</h3><p>这个大家可以去我前几篇博客上找一下，我写了一篇较为详细的OpenCV3.1编译的文章，总的来说，在Ubuntu下编译比较简单，直接clone项目，设定cmake参数，直接make all -j8就行了，然后install。这里简要lveguo（我打不出那个字，日了狗了）。</p>
<h3 id="Clion上手"><a href="#Clion上手" class="headerlink" title="Clion上手"></a>Clion上手</h3><p>Clion是Jetbrain公司开发的C++IDE，秉承了Jetbrain一系IDE美观强大的风格，比其某VC，某Qt，某CMake强大很多，然而要上手对于新手来说还是有点麻烦，首先就是这个CMakelists，你不知道怎么配置，太鸡巴麻烦了，我配置了一下午，TMD，真的是日了藏獒，后来发现还是人家OpenCV好，实际上OpenCV已经把CMakelist的样本放到了example文件夹下，我TM是当时瞎了够眼，没有看到，最后灵机一动，突然想起来，发现还真的有。</p>
<h3 id="Clion配置CMakelists-txt来导入OpenCV"><a href="#Clion配置CMakelists-txt来导入OpenCV" class="headerlink" title="Clion配置CMakelists.txt来导入OpenCV"></a>Clion配置CMakelists.txt来导入OpenCV</h3><p>怎么说，貌似你不在CMakelists里面导入OpenCV相关包你是无法通过编译的，会报错，先话不多说，加入你新建了一个Project叫做VisionTest,下面的主函数cpp名字叫做main，那么CmakeLists.txt这么配置：<br><figure class="highlight stylus"><table><tr><td class="code"><pre><div class="line"><span class="function"><span class="title">cmake_minimum_required</span><span class="params">(VERSION <span class="number">3.6</span>)</span></span></div><div class="line"><span class="function"><span class="title">project</span><span class="params">(VisionTest)</span></span></div><div class="line"></div><div class="line"></div><div class="line"><span class="function"><span class="title">find_package</span><span class="params">(OpenCV REQUIRED)</span></span></div><div class="line"><span class="function"><span class="title">message</span><span class="params">(STATUS <span class="string">"OpenCV library status:"</span>)</span></span></div><div class="line"><span class="function"><span class="title">message</span><span class="params">(STATUS <span class="string">"    version: $&#123;OpenCV_VERSION&#125;"</span>)</span></span></div><div class="line"><span class="function"><span class="title">message</span><span class="params">(STATUS <span class="string">"    libraries: $&#123;OpenCV_LIBS&#125;"</span>)</span></span></div><div class="line"><span class="function"><span class="title">message</span><span class="params">(STATUS <span class="string">"    include path: $&#123;OpenCV_INCLUDE_DIRS&#125;"</span>)</span></span></div><div class="line"><span class="function"><span class="title">include_directories</span><span class="params">($&#123;OpenCV_INCLUDE_DIRS&#125;)</span></span></div><div class="line"></div><div class="line"></div><div class="line"><span class="function"><span class="title">set</span><span class="params">(CMAKE_CXX_STANDARD <span class="number">11</span>)</span></span></div><div class="line"><span class="function"><span class="title">set</span><span class="params">(SOURCE_FILES main.cpp)</span></span></div><div class="line"></div><div class="line"><span class="function"><span class="title">add_executable</span><span class="params">(vision_test main.cpp)</span></span></div><div class="line"><span class="function"><span class="title">target_link_libraries</span><span class="params">(vision_test $&#123;OpenCV_LIBS&#125;)</span></span></div></pre></td></tr></table></figure></p>
<p>这里有个重点，最后两行一定要有，而且顺序不能变，这是告诉Cmake，你把main.cpp编译成了一个可执行文件vision_test,然后你要让这个可以执行的文件去连接OpenCV的动态库，如果你在没有add_executable就去添加链接就会报错。谨慎啊，少年，小心使得万年船啊！</p>
<h3 id="C-OpenCV测试程序示例"><a href="#C-OpenCV测试程序示例" class="headerlink" title="C++ OpenCV测试程序示例"></a>C++ OpenCV测试程序示例</h3><p>OK，现在我们配置了Cmake，接下来在main.cpp中输入以下代码：<br><figure class="highlight cpp"><table><tr><td class="code"><pre><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;iostream&gt;</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;vector&gt;</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"opencv2/core/core.hpp"</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"opencv2/opencv.hpp"</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"opencv2/highgui/highgui.hpp"</span></span></div><div class="line"></div><div class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;</div><div class="line"></div><div class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</div><div class="line">    <span class="built_in">cout</span> &lt;&lt; <span class="string">"Hello, this is opencv tutorial."</span> &lt;&lt; <span class="built_in">std</span>::<span class="built_in">endl</span>;</div><div class="line">    cv::Mat img = cv::imread(<span class="string">"/home/jfg/Pictures/cat.jpeg"</span>);</div><div class="line">    cv::namedWindow(<span class="string">"Window"</span>, CV_WINDOW_AUTOSIZE);</div><div class="line">    cv::imshow(<span class="string">"Cat"</span>, img);</div><div class="line">    cv::waitKey(<span class="number">0</span>);</div><div class="line">    <span class="keyword">return</span> <span class="number">0</span>;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>这是一个简单的OpenCV测试程序，要注意的一点是，图片的路径要使用绝对路径，不要使用相对路径，否则会出错。</p>
<h3 id="OpenCV-MoveOn"><a href="#OpenCV-MoveOn" class="headerlink" title="OpenCV MoveOn"></a>OpenCV MoveOn</h3><p>其实写这个博客的目的并不是上手OpenCV，基于Linux来做OpenCV编程是因为，我想让OpenCV和硬件结合起来，最理想的方案就是树莓派了，这样通过Linux系统我们就可以让上位机和下位机连接起来，使用这个再加上独门绝迹，深度学习目标检测以及表情识别，想想还是很6的！！</p>
<h3 id="人工智能机器人Teroi"><a href="#人工智能机器人Teroi" class="headerlink" title="人工智能机器人Teroi"></a>人工智能机器人Teroi</h3><p>我决定把我的第一台人工智能机器人名字叫做Teroi，意思是：<br>The Emotional Robot Improved.<br>大家觉得怎么样？</p>

      
    </div>
    <footer class="article-footer">
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/深度学习/">深度学习</a></li></ul>

    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Django-4-django和postgreSQL"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/01/26/Django-4-django和postgreSQL/">Django 4 django和postgreSQL</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/01/26/Django-4-django和postgreSQL/" class="article-date">
	  <time datetime="2017-01-26T10:41:45.000Z" itemprop="datePublished">2017-01-26</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>这个教程是要换数据库了，从mysql换到postgresql。说实话我个人以后决定使用postgresql，比mysql方便很多。<br>
        <!-- 这个教程是要换数据库了，从mysql换到postgresql。说实话我个人以后决定使用postgresql，比mysql方便很多。

本文由作者金天原创，欢迎大家转载，不过请保留这段版权信息，多谢合作，如对本文有任何问题欢迎联系作者: jintianiloveu。

postgresql安装教程在这插入一下安装过程，之前安装了现在又重新搭建一遍所以记录一下，其实不管是Mac还是Linux都很......  -->
        <p class="article-more-link">
          <a href="/2017/01/26/Django-4-django和postgreSQL/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Django/">Django</a></li></ul>

    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Django-3-分分钟搭建一个RESTful-API"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/01/16/Django-3-分分钟搭建一个RESTful-API/">Django 3 分分钟搭建一个RESTful API</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/01/16/Django-3-分分钟搭建一个RESTful-API/" class="article-date">
	  <time datetime="2017-01-16T15:31:58.000Z" itemprop="datePublished">2017-01-16</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="Django-restframework-简介"><a href="#Django-restframework-简介" class="headerlink" title="Django restframework 简介"></a>Django restframework 简介</h3><p>时间过得好快，不知不觉这就是Django系列教程的第三部分了，这部分我们将在一分钟之内用django的一个第三方框架-Django restframework搭建我们的第一个api。首先闲话不多说让我们先安装一下这个框架：<br><figure class="highlight cmake"><table><tr><td class="code"><pre><div class="line">sudo pip3 <span class="keyword">install</span> django-restframework</div></pre></td></tr></table></figure></p>
<p>ok，安装完之后能让我们新建一个project吧<br><figure class="highlight ebnf"><table><tr><td class="code"><pre><div class="line"><span class="attribute">django-admin startproject ara</span></div></pre></td></tr></table></figure></p>
<p>接着新建一个app：<br><figure class="highlight stylus"><table><tr><td class="code"><pre><div class="line">python3 manage<span class="selector-class">.py</span> startapp users</div></pre></td></tr></table></figure></p>
<p>ok这时候我们的项目结构应该是这样的：<br><figure class="highlight stylus"><table><tr><td class="code"><pre><div class="line">.</div><div class="line">├── ara</div><div class="line">│   ├── __init__<span class="selector-class">.py</span></div><div class="line">│   ├── settings<span class="selector-class">.py</span></div><div class="line">│   ├── urls<span class="selector-class">.py</span></div><div class="line">│   └── wsgi<span class="selector-class">.py</span></div><div class="line">└── users</div><div class="line">    ├── __init__<span class="selector-class">.py</span></div><div class="line">    ├── admin<span class="selector-class">.py</span></div><div class="line">    ├── apps<span class="selector-class">.py</span></div><div class="line">    ├── models<span class="selector-class">.py</span></div><div class="line">    ├── tests<span class="selector-class">.py</span></div><div class="line">    └── views.py</div></pre></td></tr></table></figure></p>
<p>ok，简单易懂，接着还是我们配置一下restframework吧</p>
<h3 id="Restframework配置"><a href="#Restframework配置" class="headerlink" title="Restframework配置"></a>Restframework配置</h3><p>配置这个框架请依照这个步骤来，缺一不可：</p>
<ul>
<li><p><strong>在settings.py中我们install一下</strong></p>
<figure class="highlight sml"><table><tr><td class="code"><pre><div class="line"><span class="type">INSTALLED_APPS</span> = [</div><div class="line">    <span class="symbol">'django</span>.contrib.admin',</div><div class="line">    <span class="symbol">'django</span>.contrib.auth',</div><div class="line">    <span class="symbol">'django</span>.contrib.contenttypes',</div><div class="line">    <span class="symbol">'django</span>.contrib.sessions',</div><div class="line">    <span class="symbol">'django</span>.contrib.messages',</div><div class="line">    <span class="symbol">'django</span>.contrib.staticfiles',</div><div class="line">    <span class="symbol">'users'</span>,</div><div class="line">    <span class="symbol">'rest_framework'</span></div><div class="line">]</div></pre></td></tr></table></figure>
</li>
<li><p><strong>在settings.py中添加这个</strong></p>
<figure class="highlight ada"><table><tr><td class="code"><pre><div class="line"># using rest_framework setting this line</div><div class="line">REST_FRAMEWORK = &#123;</div><div class="line">    # <span class="keyword">Use</span> Django<span class="symbol">'s</span> standard `django.contrib.auth` permissions,</div><div class="line">    # <span class="keyword">or</span> allow read-only <span class="keyword">access</span> <span class="keyword">for</span> unauthenticated users.</div><div class="line">    <span class="symbol">'DEFAULT_PERMISSION_CLASSES</span>': [</div><div class="line">        <span class="symbol">'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly</span>'</div><div class="line">    ]</div><div class="line">&#125;</div></pre></td></tr></table></figure>
</li>
</ul>
<p>ok，经过这个配置之后，我们就可以在项目中import restframework了。接下来我要向同志们展示一下这个东西到底有多么吊炸天！</p>
<h3 id="三步搞定一套API，增删改查！"><a href="#三步搞定一套API，增删改查！" class="headerlink" title="三步搞定一套API，增删改查！"></a>三步搞定一套API，增删改查！</h3><p>我说过只用三步，那我们就分三步来。</p>
<ul>
<li><strong>第1步：</strong> 当然是新建一个models</li>
</ul>
<p>二话不多说直接复制粘贴代码：<br><figure class="highlight python"><table><tr><td class="code"><pre><div class="line"><span class="comment"># -*- coding: utf-8 -*-</span></div><div class="line"><span class="keyword">from</span> django.db <span class="keyword">import</span> models</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment"># Create your models here.</span></div><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">User</span><span class="params">(models.Model)</span>:</span></div><div class="line">    <span class="string">"""</span></div><div class="line">    name: name of user,</div><div class="line">    gender: user's gender</div><div class="line">    wechat: user's wechat</div><div class="line">    """</div><div class="line">    name = models.CharField(max_length=<span class="number">100</span>, blank=<span class="keyword">False</span>)</div><div class="line">    gender = models.CharField(max_length=<span class="number">4</span>, blank=<span class="keyword">True</span>)</div><div class="line">    birthday = models.DateField(blank=<span class="keyword">True</span>)</div><div class="line">    portrait_url = models.CharField(max_length=<span class="number">100</span>, blank=<span class="keyword">True</span>)</div><div class="line">    home = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line">    phone = models.CharField(max_length=<span class="number">17</span>, blank=<span class="keyword">True</span>)</div><div class="line">    email = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line">    wechat = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line">    company = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line">    occupation = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line">    living_city = models.CharField(max_length=<span class="number">20</span>, blank=<span class="keyword">True</span>)</div><div class="line"></div><div class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__str__</span><span class="params">(self)</span>:</span></div><div class="line">        <span class="keyword">return</span> self.name</div></pre></td></tr></table></figure></p>
<ul>
<li><strong>第2步：</strong> 在app下新建serializers.py，写入这些代码</li>
</ul>
<p>二话不多说直接复制粘贴代码：<br><figure class="highlight python"><table><tr><td class="code"><pre><div class="line"><span class="keyword">from</span> rest_framework <span class="keyword">import</span> serializers, viewsets</div><div class="line"><span class="keyword">from</span> users.models <span class="keyword">import</span> User</div><div class="line"></div><div class="line"></div><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">UsersSerializer</span><span class="params">(serializers.ModelSerializer)</span>:</span></div><div class="line"></div><div class="line">    <span class="class"><span class="keyword">class</span> <span class="title">Meta</span>:</span></div><div class="line">        model = User</div><div class="line">        fields = <span class="string">'__all__'</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="comment"># ViewSets define the view behavior.</span></div><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">UsersViewSet</span><span class="params">(viewsets.ModelViewSet)</span>:</span></div><div class="line">    queryset = User.objects.all()</div><div class="line">    serializer_class = UsersSerializer</div></pre></td></tr></table></figure></p>
<p>在这里我们实现一个UsersSerializers以及一个UsersViewSet这两个类，这个序列化函数暂且不知道是干毛的，但是很显然这个函数的作用是把从数据库中查询的结果序列化为字符串。不过重点是这个ViewSet，这个东西就这么几行代码它就帮你实现好了增、删、改、查的所有功能。不是吹牛逼等一下我们来验证看看是不是。<br>你会惊奇的发现，有了这个ViewSet之后我们都不用写view.py了！！！！！</p>
<ul>
<li><strong>第3步：</strong> 配置urls<br>二话不多说直接复制粘贴代码：<figure class="highlight python"><table><tr><td class="code"><pre><div class="line"><span class="keyword">from</span> django.conf.urls <span class="keyword">import</span> url, include</div><div class="line"><span class="keyword">from</span> django.contrib <span class="keyword">import</span> admin</div><div class="line"><span class="keyword">from</span> users.serializers <span class="keyword">import</span> UsersViewSet</div><div class="line"><span class="keyword">from</span> rest_framework <span class="keyword">import</span> routers</div><div class="line"></div><div class="line">router = routers.DefaultRouter()</div><div class="line">router.register(<span class="string">r'api/v1/users'</span>, UsersViewSet)</div><div class="line"></div><div class="line">urlpatterns = [</div><div class="line">    url(<span class="string">r'^admin/'</span>, admin.site.urls),</div><div class="line">    url(<span class="string">r'^api-auth/'</span>, include(<span class="string">'rest_framework.urls'</span>, namespace=<span class="string">'rest_framework'</span>)),</div><div class="line">    url(<span class="string">r'^'</span>, include(router.urls))</div><div class="line">]</div></pre></td></tr></table></figure>
</li>
</ul>
<p>配置urls要用到restframework中的router这个类，这个是一个路由器，或者说是分发器，request的网址分发过来我发给哪个view处理就有他来决定，但是很显然这里并没有发给任何一个view，而是直接发给了一个ViewSet，这个ViewSet结合我们的serializer就可以实现我们的返回json或者接受json的全套功能！就是这么的屌！屌的爆炸！！<br>好吧，最后说一下urlpatterns里面的几个pattern，第一个是admin不需要多说，重点是最后一个我们include了router的urls，所以说你只需要按照router的网址来写即可，不过重点是router还实现了一个隐士查询也就是你可以加具体数字查询具体的detail。</p>
<h3 id="Django-restframework测试！"><a href="#Django-restframework测试！" class="headerlink" title="Django restframework测试！"></a>Django restframework测试！</h3><p>说了这么多来测试一下呗！！我们输入：<br><figure class="highlight awk"><table><tr><td class="code"><pre><div class="line">http:<span class="regexp">//</span><span class="number">127.0</span>.<span class="number">0.1</span>:<span class="number">8000</span><span class="regexp">/api/</span>v1<span class="regexp">/users</span></div></pre></td></tr></table></figure></p>
<p>看看返回的结果：<br><figure class="highlight groovy"><table><tr><td class="code"><pre><div class="line">HTTP <span class="number">200</span> OK</div><div class="line"><span class="string">Allow:</span> GET, POST, OPTIONS</div><div class="line">Content-<span class="string">Type:</span> application/json</div><div class="line"><span class="string">Vary:</span> Accept</div><div class="line"></div><div class="line">[</div><div class="line">    &#123;</div><div class="line">        <span class="string">"id"</span>: <span class="number">1</span>,</div><div class="line">        <span class="string">"name"</span>: <span class="string">"金天"</span>,</div><div class="line">        <span class="string">"gender"</span>: <span class="string">"男"</span>,</div><div class="line">        <span class="string">"birthday"</span>: <span class="string">"1993-12-11"</span>,</div><div class="line">        <span class="string">"portrait_url"</span>: <span class="string">"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1593523098,2479335990&amp;fm=116&amp;gp=0.jpg"</span>,</div><div class="line">        <span class="string">"home"</span>: <span class="string">"江西南昌"</span>,</div><div class="line">        <span class="string">"phone"</span>: <span class="string">"15116123160"</span>,</div><div class="line">        <span class="string">"email"</span>: <span class="string">"1195889656@qq.com"</span>,</div><div class="line">        <span class="string">"wechat"</span>: <span class="string">"jintianilveu"</span>,</div><div class="line">        <span class="string">"company"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"occupation"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"living_city"</span>: <span class="string">""</span></div><div class="line">    &#125;,</div><div class="line">    &#123;</div><div class="line">        <span class="string">"id"</span>: <span class="number">2</span>,</div><div class="line">        <span class="string">"name"</span>: <span class="string">"Elgins"</span>,</div><div class="line">        <span class="string">"gender"</span>: <span class="string">"男"</span>,</div><div class="line">        <span class="string">"birthday"</span>: <span class="string">"1994-11-02"</span>,</div><div class="line">        <span class="string">"portrait_url"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"home"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"phone"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"email"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"wechat"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"company"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"occupation"</span>: <span class="string">""</span>,</div><div class="line">        <span class="string">"living_city"</span>: <span class="string">""</span></div><div class="line">    &#125;</div><div class="line">]</div></pre></td></tr></table></figure></p>
<p>在网页中你可以直接测试POST PUT GET等方法，总是很牛逼有没有！！分分钟做一套API啊！！比java web快出了不知道多少倍！！！明天我们继续深入探测这个东西！！！！！</p>

      
    </div>
    <footer class="article-footer">
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Django/">Django</a></li></ul>

    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Django-2-MySQL-and-Blog"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/01/15/Django-2-MySQL-and-Blog/">Django 2 MySQL and Blog</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/01/15/Django-2-MySQL-and-Blog/" class="article-date">
	  <time datetime="2017-01-15T10:14:45.000Z" itemprop="datePublished">2017-01-15</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <h3 id="mysql-usage"><a href="#mysql-usage" class="headerlink" title="mysql usage"></a>mysql usage</h3><p>In this post I am going writting some useful commonds of mysql, hand this you can operate Database as cake.</p>
<ol>
<li><p><strong>Change specific database encode</strong></p>
<figure class="highlight sql"><table><tr><td class="code"><pre><div class="line"><span class="keyword">ALTER</span> <span class="keyword">DATABASE</span> ara <span class="built_in">CHARACTER</span> <span class="keyword">SET</span> utf8;</div></pre></td></tr></table></figure>
</li>
<li><p><strong>Change all database encode</strong></p>
<figure class="highlight gams"><table><tr><td class="code"><pre><div class="line"><span class="keyword">SET</span> CHARACTER_SET_CONNECTTION=utf8;</div><div class="line"><span class="keyword">SET</span> CHARACTER_SET_DATABASE=utf8;</div><div class="line"><span class="keyword">SET</span> CHARACTER_SET_SERVER=utf8;</div><div class="line"><span class="keyword">SET</span> CHARACTER_SET_CLIENT=utf8;</div></pre></td></tr></table></figure>
</li>
<li><p><strong>Ultimate method to change encode of mysql</strong><br>ok, I have to admmit that above method you cannot really change mysql’s encode, it still be latin1 for character_database and character_server. But using this you can change the encode method forever. First of all, please make sure you have stop mysql.<br><strong>Step 1</strong><br>copy <code>my-default.cnf</code> to <code>/etc/my.cnf</code>, using:</p>
<figure class="highlight vim"><table><tr><td class="code"><pre><div class="line"><span class="keyword">cp</span> /usr/local/mysql/support-<span class="keyword">files</span>/my-default.<span class="keyword">cnf</span> /etc/my.<span class="keyword">cnf</span></div></pre></td></tr></table></figure>
</li>
</ol>
<p><strong>Step 2</strong><br>changing a exactly right to that file, make sure only you can write and read it, using:<br><figure class="highlight applescript"><table><tr><td class="code"><pre><div class="line">sudo chmod <span class="number">644</span> <span class="keyword">my</span>.cnf</div></pre></td></tr></table></figure></p>
<p><strong>Step 3</strong><br>add this lines to the file:<br><figure class="highlight vim"><table><tr><td class="code"><pre><div class="line">sudo <span class="keyword">vim</span> my.<span class="keyword">cnf</span></div></pre></td></tr></table></figure></p>
<figure class="highlight ini"><table><tr><td class="code"><pre><div class="line"><span class="section">[client]</span></div><div class="line"><span class="attr">default-character-set</span>=utf8</div></pre></td></tr></table></figure>
<p>under <code>[mysqld]</code> adding this:<br><figure class="highlight ini"><table><tr><td class="code"><pre><div class="line"><span class="attr">default-storage-engine</span>=INNODB</div><div class="line"><span class="attr">character-set-server</span>=utf8</div><div class="line"><span class="attr">collation-server</span>=utf8_general_ci</div></pre></td></tr></table></figure></p>
<p>ok, then save and quit, start mysql, and you will find:<br><figure class="highlight asciidoc"><table><tr><td class="code"><pre><div class="line"><span class="section">mysql&gt; show variables like "%char%";</span></div><div class="line">+--------------------------+---------------------------------------------------------+</div><div class="line"><span class="section">| Variable_name            | Value                                                   |</span></div><div class="line">+--------------------------+---------------------------------------------------------+</div><div class="line">| character<span class="emphasis">_set_</span>client     | utf8                                                    |</div><div class="line">| character<span class="emphasis">_set_</span>connection | utf8                                                    |</div><div class="line">| character<span class="emphasis">_set_</span>database   | utf8                                                    |</div><div class="line">| character<span class="emphasis">_set_</span>filesystem | binary                                                  |</div><div class="line">| character<span class="emphasis">_set_</span>results    | utf8                                                    |</div><div class="line">| character<span class="emphasis">_set_</span>server     | utf8                                                    |</div><div class="line">| character<span class="emphasis">_set_</span>system     | utf8                                                    |</div><div class="line"><span class="section">| character_sets_dir       | /usr/local/mysql-5.7.16-osx10.11-x86_64/share/charsets/ |</span></div><div class="line">+--------------------------+---------------------------------------------------------+</div><div class="line">8 rows in set (0.01 sec)</div></pre></td></tr></table></figure></p>

      
    </div>
    <footer class="article-footer">
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Django/">Django</a></li></ul>

    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Django-1-Django上手教程"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/01/12/Django-1-Django上手教程/">Django 1 Django和mysql</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/01/12/Django-1-Django上手教程/" class="article-date">
	  <time datetime="2017-01-12T12:31:45.000Z" itemprop="datePublished">2017-01-12</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>这个post是讲述django和mysql的故事，记录django常用命令以及mysql的python接口安装方法，环境为python3.6。<br>
        <!-- 这个post是讲述django和mysql的故事，记录django常用命令以及mysql的python接口安装方法，环境为python3.6。

本文由作者金天原创，欢迎大家转载，不过请保留这段版权信息，多谢合作，如对本文有任何问题欢迎联系作者: jintianiloveu。

Django大法作为一位极客，不会点服务端还真不行，现在什么都离不开云啊，最近一直想建站，app接口也要用到云，本......  -->
        <p class="article-more-link">
          <a href="/2017/01/12/Django-1-Django上手教程/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Django/">Django</a></li></ul>

    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Mac下安装和使用postgreSQL"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2017/01/02/Mac下安装和使用postgreSQL/">Mac下安装和使用postgreSQL</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2017/01/02/Mac下安装和使用postgreSQL/" class="article-date">
	  <time datetime="2017-01-02T07:02:18.000Z" itemprop="datePublished">2017-01-02</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>本文介绍Mac下如何对nexus进行刷机，实际上还是非常简单的，10分钟即可搞定，然后就是nexu6的root教程<br>
        <!-- 本文介绍Mac下如何对nexus进行刷机，实际上还是非常简单的，10分钟即可搞定，然后就是nexu6的root教程

本文由在当地较为英俊的男子金天撰写，大家有任何疑问欢迎联系我: jintianiloveu

Mac下快速安装postgreSQL开始开车之前我们花一分钟的时间来安装一下这个，说是一分钟实际上一分钟都不需要，如果你是开发者，mac上应该安装了brew吧，我们直接用brew安装......  -->
        <p class="article-more-link">
          <a href="/2017/01/02/Mac下安装和使用postgreSQL/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Yolo训练自己的数据集教程-Newest-2016-12-23"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/22/Yolo训练自己的数据集教程-Newest-2016-12-23/">Yolo训练自己的数据集教程 Newest(2016-12-23)</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/22/Yolo训练自己的数据集教程-Newest-2016-12-23/" class="article-date">
	  <time datetime="2016-12-22T10:27:38.000Z" itemprop="datePublished">2016-12-22</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>yolo教程<br>
        <!-- yolo教程
Yolo darknet训练自己的数据集教程(Newest 2016.12.23)
经过两天的折腾终于搞定了Yolo训练自己的数据集的过程，整个过程其实并不繁琐，只是网上一些过时的教程已经不适用了，依照那个反而让大家各种出出错，加之Yolo中文教程过少，因此本大神再次放一个，如果大家有任何问题直接在文章后面评论即可，笔者看到之后给予第一时间回复。

先插一句，Atom中文不能跟......  -->
        <p class="article-more-link">
          <a href="/2016/12/22/Yolo训练自己的数据集教程-Newest-2016-12-23/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-夜有所思"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/11/夜有所思/">夜有所思</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/11/夜有所思/" class="article-date">
	  <time datetime="2016-12-11T15:35:30.000Z" itemprop="datePublished">2016-12-11</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>本文是我的一个随笔<br>
        <!-- 本文是我的一个随笔

你有过思念的感觉吗？

桃花谢了春红，太匆匆，却是朝来风雨晚来风岁月悄然流淌，我们也在成长，可是在成长的岁月里那些留给我们的感动我们还记得多少呢？以前只有离别家乡的时候才会与依依不舍之情，现在离开的这个地方不是家乡，却有着跟家乡一样的感觉，有着牵挂的人，这也许就是一种魂牵梦绕的情愫吧。今天把博客从实验室搬到了自己的笔记本，宾至如归，所有的事情我都想好好的握在手里，不至于......  -->
        <p class="article-more-link">
          <a href="/2016/12/11/夜有所思/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-git命令删除当前远程仓库依赖"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/11/git命令删除当前远程仓库依赖/">git命令删除当前远程仓库依赖</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/11/git命令删除当前远程仓库依赖/" class="article-date">
	  <time datetime="2016-12-11T13:51:12.000Z" itemprop="datePublished">2016-12-11</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>git命令简介<br>
        <!-- git命令简介
学会使用git命令，不仅仅可以远程操控一切，还可以节省很多体力劳动，比如插优盘拔优盘..

本文由中南大学较为牛逼的研究生金天同学原创，欢迎转载，但是请保留这段版权信息，如果你对文章有任何疑问，欢迎微信联系我：jintianiloveu。牛逼大神一一为你解答！

git命令使用简介git命令其实非常简单，但是网上的教程大多数都是乱七八糟，误人子弟，其实要我来讲，只需要记住一个......  -->
        <p class="article-more-link">
          <a href="/2016/12/11/git命令删除当前远程仓库依赖/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Mac下为nexus6刷入官方系统并root"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/05/Mac下为nexus6刷入官方系统并root/">Mac下为nexus6刷入官方系统并root</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/05/Mac下为nexus6刷入官方系统并root/" class="article-date">
	  <time datetime="2016-12-05T07:02:18.000Z" itemprop="datePublished">2016-12-05</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>本文介绍Mac下如何对nexus进行刷机，实际上还是非常简单的，10分钟即可搞定，然后就是nexu6的root教程<br>
        <!-- 本文介绍Mac下如何对nexus进行刷机，实际上还是非常简单的，10分钟即可搞定，然后就是nexu6的root教程

本文由作者金天原创，欢迎大家转载，不过请保留这段版权信息，多谢合作，如对本文有任何问题欢迎联系作者: jintianiloveu


安装adb直接用homebrew安装即可：
brew install android-platform-tools

下载google官方镜像......  -->
        <p class="article-more-link">
          <a href="/2016/12/05/Mac下为nexus6刷入官方系统并root/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="psot-Android开车第一弹-MaterialDesign设计规范"  class="article article-type-psot" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/04/Android开车第一弹-MaterialDesign设计规范/">Android开车第一弹-MaterialDesign设计规范</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/04/Android开车第一弹-MaterialDesign设计规范/" class="article-date">
	  <time datetime="2016-12-04T14:10:02.000Z" itemprop="datePublished">2016-12-04</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>本文是Android学的一个随笔<br>
        <!-- 本文是Android学的一个随笔
会iOS再来学Android，一切就像行云流水一样融会贯通，从某种意义上来讲，Android比iOS简单，iOS能够实现更精细的布局，但是也更复杂。Android大条随意，这也是为什么我想学习它的原因。

本文由中南大学较为牛逼的研究生金天同学原创，欢迎转载，但是请保留这段版权信息，如果你对文章有任何疑问，欢迎微信联系我：jintianiloveu。牛逼大神......  -->
        <p class="article-more-link">
          <a href="/2016/12/04/Android开车第一弹-MaterialDesign设计规范/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-mxnet开车教程series1-mnist上手"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/03/mxnet开车教程series1-mnist上手/">mxnet开车教程series1-mnist上手</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/03/mxnet开车教程series1-mnist上手/" class="article-date">
	  <time datetime="2016-12-03T13:50:54.000Z" itemprop="datePublished">2016-12-03</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>mxnet入门中文教程，让我们从mnist果蝇数据集开始开车<br>
        <!-- mxnet入门中文教程，让我们从mnist果蝇数据集开始开车

本文由中南大学较为牛逼的研究生金天同学原创，欢迎转载，但是请保留这段版权信息，如果你对文章有任何疑问，欢迎微信联系我：jintianiloveu。牛逼大神一一为你解答！

前言最近搭建起了深度学习环境，mxnet被亚马逊钦定为官方的机器学习库，加上mxnet快速，代码清晰的特点，我赶紧乘上了mxnet快车，准备以mxnet为基础......  -->
        <p class="article-more-link">
          <a href="/2016/12/03/mxnet开车教程series1-mnist上手/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Ubuntu下编译opencv并生成python链接库详细教程-吐血编译系列"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/03/Ubuntu下编译opencv并生成python链接库详细教程-吐血编译系列/">Ubuntu下编译opencv并生成python链接库详细教程-吐血编译系列</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/03/Ubuntu下编译opencv并生成python链接库详细教程-吐血编译系列/" class="article-date">
	  <time datetime="2016-12-03T02:20:47.000Z" itemprop="datePublished">2016-12-03</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>本文将解决的是opencv这个洪水猛兽，opencv功能强大，但是无论在ubuntu下还是在windows下编译都非常麻烦，本文将编译它，并生成python调用库。哥搞了好几天才搞定，shit！<br>
        <!-- 本文将解决的是opencv这个洪水猛兽，opencv功能强大，但是无论在ubuntu下还是在windows下编译都非常麻烦，本文将编译它，并生成python调用库。哥搞了好几天才搞定，shit！

本文由中南大学较为牛逼的研究生金天同学原创，欢迎转载，但是请保留这段版权信息，如果你对文章有任何疑问，欢迎微信联系我：jintianiloveu。牛逼大神一一为你解答！

前言opencv3.1 ......  -->
        <p class="article-more-link">
          <a href="/2016/12/03/Ubuntu下编译opencv并生成python链接库详细教程-吐血编译系列/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Ubuntu大手术-更换home的挂载分区获取更大空间"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/03/Ubuntu大手术-更换home的挂载分区获取更大空间/">Ubuntu大手术-更换home的挂载分区获取更大空间</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/03/Ubuntu大手术-更换home的挂载分区获取更大空间/" class="article-date">
	  <time datetime="2016-12-03T01:48:43.000Z" itemprop="datePublished">2016-12-03</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>Ubuntu系统安装时由于年少无知瞎几把设置分区，结果最后导致空间不够用，不过不用担心，本教程教你如何在不装系统的情况之下对分区进行修改<br>
        <!-- Ubuntu系统安装时由于年少无知瞎几把设置分区，结果最后导致空间不够用，不过不用担心，本教程教你如何在不装系统的情况之下对分区进行修改

本文由中南大学较为牛逼的研究生金天同学原创，欢迎转载，但是请保留这段版权信息，如果你对文章有任何疑问，欢迎微信联系我：jintianiloveu。牛逼大神一一为你解答！

准备一个更大的分区首先当然最要紧的是准备一个更大的分区，这里我建议大家选择一个分区......  -->
        <p class="article-more-link">
          <a href="/2016/12/03/Ubuntu大手术-更换home的挂载分区获取更大空间/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  
    <article id="post-Ubuntu下设置AndroidStudio的启动快捷方式"  class="article article-type-post" itemscope itemprop="blogPost" >
  <div id="articleInner" class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="thumb" itemprop="name">
      <a class="article-title" href="/2016/12/02/Ubuntu下设置AndroidStudio的启动快捷方式/">Ubuntu下设置AndroidStudio的启动快捷方式</a>
    </h1>
  

      </header>
    
    <div class="article-meta">
      
	<a href="/2016/12/02/Ubuntu下设置AndroidStudio的启动快捷方式/" class="article-date">
	  <time datetime="2016-12-02T12:52:03.000Z" itemprop="datePublished">2016-12-02</time>
	</a>

      
      
    </div>
    <div class="article-entry" itemprop="articleBody">
      
        <p>Ubuntu下设置AndroidStudio的快捷方式<br>
        <!-- Ubuntu下设置AndroidStudio的快捷方式

本文由作者金天原创，欢迎大家转载，不过请保留这段版权信息，多谢合作，如对本文有任何问题欢迎联系作者: jintianiloveu

Ubuntu下设置AndroidStudio快捷方式Ubuntu下安装AndroidStudio不需要多讲，直接下载deb包，然后安装，一般安装在/opt/文件夹下，但是有个问题无法生成快捷方式，这就非常......  -->
        <p class="article-more-link">
          <a href="/2016/12/02/Ubuntu下设置AndroidStudio的启动快捷方式/#more">阅读全文</a>
        </p>
      
    </div>
    <footer class="article-footer">
      
      
      
    </footer>
  </div>
  
</article>

<!-- Table of Contents -->

  


  <nav id="page-nav">
    
    <a class="extend prev" rel="prev" href="/page/5/">&laquo; 上一页</a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/">4</a><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" href="/page/7/">下一页 &raquo;</a>
  </nav>

</section>
        
      </div>
      
        <div align="center" style="margin-top: 30px;"><hr class="hr" style="margin:0px; height:3px;"></div>
      
      <footer id="footer">
  

  <div class="container">
      	<div class="row">
	      <p> Powered by <a href="http://www.luoli-luoli.com/" target="_blank">萝莉萝莉</a> and <a href="http://www.luoli-luoli.com/sia" target="_blank">Sia</a> </p>
	      <p id="copyRightEn">Copyright &copy; 2017 - 2018 Jin Tian All Rights Reserved.</p>
	      
	      
    		<p class="busuanzi_uv">
				访客数 : <span id="busuanzi_value_site_uv"></span> |  
				访问量 : <span id="busuanzi_value_site_pv"></span>
		    </p>
  		   
		</div>

		
  </div>
</footer>


<!-- min height -->

<script>
    var wrapdiv = document.getElementById("wrap");
    var contentdiv = document.getElementById("content");
    var allheader = document.getElementById("allheader");

    wrapdiv.style.minHeight = document.body.offsetHeight + "px";
    if (allheader != null) {
      contentdiv.style.minHeight = document.body.offsetHeight - allheader.offsetHeight - document.getElementById("footer").offsetHeight + "px";
    } else {
      contentdiv.style.minHeight = document.body.offsetHeight - document.getElementById("footer").offsetHeight + "px";
    }
</script>
    </div>
    <!-- <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
    <a href="/categories" class="mobile-nav-link">Categories</a>
  
    <a href="/tags" class="mobile-nav-link">Tags</a>
  
    <a href="/about" class="mobile-nav-link">About</a>
  
    <a href="http://luoli-luoli.com/chat" class="mobile-nav-link">Chat</a>
  
</nav> -->
    

<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/scripts.js"></script>


  <script src="/js/home.js"></script>










	<div style="display: none;">
    <script src="https://s95.cnzz.com/z_stat.php?id=1260716016&web_id=1260716016" language="JavaScript"></script>
  </div>



	<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
	</script>






  </div>

  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2 class="modal-title" id="myModalLabel">设置</h2>
      </div>
      <hr style="margin-top:0px; margin-bottom:0px; width:80%; border-top: 3px solid #000;">
      <hr style="margin-top:2px; margin-bottom:0px; width:80%; border-top: 1px solid #000;">


      <div class="modal-body">
          <div style="margin:6px;">
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" onclick="javascript:setFontSize();" aria-expanded="true" aria-controls="collapseOne">
              正文字号大小
            </a>
          </div>
          <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
          <div class="panel-body">
            您已调整页面字体大小
          </div>
        </div>
      


          <div style="margin:6px;">
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" onclick="javascript:setBackground();" aria-expanded="true" aria-controls="collapseTwo">
              夜间护眼模式
            </a>
        </div>
          <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
          <div class="panel-body">
            夜间模式已经开启，再次单击按钮即可关闭 
          </div>
        </div>

        <div>
            <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;关 于&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
        </div>
         <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree">
          <div class="panel-body">
            Jin Tian
          </div>
          <div class="panel-body">
            Copyright © 2018 Jintian All Rights Reserved.
          </div>
        </div>
      </div>


      <hr style="margin-top:0px; margin-bottom:0px; width:80%; border-top: 1px solid #000;">
      <hr style="margin-top:2px; margin-bottom:0px; width:80%; border-top: 3px solid #000;">
      <div class="modal-footer">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
      </div>
    </div>
  </div>
</div>
  
  <a id="rocket" href="#top" class=""></a>
  <script type="text/javascript" src="/js/totop.js?v=1.0.0" async=""></script>
  
</body>
</html>